CachedSynchronizedSet
Represents a thread-safe set with a cached array of its elements for improved performance.
Erbt von: SynchronizedSet<T>
Konstruktoren
public CachedSynchronizedSet()
cachedSynchronizedSet = CachedSynchronizedSet()
Initializes a new instance of the CachedSynchronizedSet class.
public CachedSynchronizedSet(bool allowIndexing)
cachedSynchronizedSet = CachedSynchronizedSet(allowIndexing)
Initializes a new instance of the CachedSynchronizedSet class with the specified indexing option.
- allowIndexing
- A value indicating whether indexing is allowed.
public CachedSynchronizedSet(IEnumerable<T> collection)
cachedSynchronizedSet = CachedSynchronizedSet(collection)
Initializes a new instance of the CachedSynchronizedSet class with the specified collection.
- collection
- The collection whose elements are copied to the new set.
public CachedSynchronizedSet(IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(comparer)
Initializes a new instance of the CachedSynchronizedSet class with the specified equality comparer.
- comparer
- The equality comparer to use when comparing elements.
public CachedSynchronizedSet(IEnumerable<T> collection, IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(collection, comparer)
Initializes a new instance of the CachedSynchronizedSet class with the specified collection and equality comparer.
- collection
- The collection whose elements are copied to the new set.
- comparer
- The equality comparer to use when comparing elements.
public CachedSynchronizedSet(bool allowIndexing, IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(allowIndexing, comparer)
Initializes a new instance of the CachedSynchronizedSet class with the specified indexing option and equality comparer.
- allowIndexing
- A value indicating whether indexing is allowed.
- comparer
- The equality comparer to use when comparing elements.
public CachedSynchronizedSet(bool allowIndexing, IEnumerable<T> collection, IEqualityComparer<T> comparer)
cachedSynchronizedSet = CachedSynchronizedSet(allowIndexing, collection, comparer)
Initializes a new instance of the CachedSynchronizedSet class with the specified indexing option, collection, and equality comparer.
- allowIndexing
- A value indicating whether indexing is allowed.
- collection
- The collection whose elements are copied to the new set.
- comparer
- The equality comparer to use when comparing elements.
Eigenschaften
public T[] Cache { get; }
value = cachedSynchronizedSet.Cache
Gets a cached array of the elements in the set.
Methoden
protected override void OnChanged()
cachedSynchronizedSet.OnChanged()
Called when the set is modified to reset the cached array.